<template>
	<div class="school">
		<h2>我是School组件 (子组件)</h2>
		<button @click="handleSendName">点我组件把学校名称交给App组件去展示</button>
		<h3>学校名称: {{name}}</h3>
		<h3>学校名称: {{address}}</h3>
	</div>
</template>

<script>
	export default {
		name: 'School',
		data(){
			return{
				name: '尚硅谷',
				address: '宏福科技园'
			}
		},
		methods: {
			handleSendName(){
				this.$emit('delivery',this.name)
			}
		}
	}
</script>

<style>
	.school{
		background-color: skyblue;
		padding: 20px;
	}
</style>